import { request } from "@/utils/service"
import type * as Plan from "./types/plan"

/** 01. 查 */
export function getPlanDataApi(data: Plan.PlanSearchData) {
  return request<Plan.PlanResponseData>({
    url: "plan/list",
    method: "post",
    data
  })
}

/** 03 删 */
export function deletePlanApi(id: number) {
  return request({
    url: `/plan/delete/${id}`,
    method: "post"
  })
}

/** 04 批量新增  */
export function batchInsertApi(data: Plan.PlanData[]) {
  return request({
    url: "plan/batchInsert",
    method: "post",
    data
  })
}

//  05 更新
export function updatePlanApi(data: Plan.PlanData) {
  return request<ApiResponseData<boolean>>({
    url: `plan/update`,
    method: "post",
    data
  })
}
